/**
 * Created by Baggio on 2017/3/2.
 */
$(function () {

    $("#modifyUserSubmit").click(function () {
        if ($("#userName").val() == '') {
            alert("请输入账号！");
            return;
        }

        $("#adminUserForm").ajaxSubmit({
            type: "POST",
            url: '/admin/user/modifyUser',
            data: $('#adminUserForm').serialize(),// 你的formid
            error: function (request) {
                $("#loading").hide();
                alert("Connection error");
            },
            beforeSend: function () {
                console.log("begin...............");
                $("#loading").show();
                $("#mask").show();

            },
            success: function (data) {
                console.log(data);
                if (data.code != 1) {
                    alert(data.msg);
                    return;
                }

                alert(data.msg);
            },
            complete: function (XMLHttpRequest, textStatus) {
                // alert('远程调用成功，状态文本值：'+textStatus);
                console.log("end...............");
                $("#loading").hide();
                $("#mask").hide();
            },
        });

    })
});

